package au.com.handsunited.web.util.displaytag;

import java.util.List;

import org.displaytag.pagination.PaginatedList;
import org.displaytag.properties.SortOrderEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import au.com.handsunited.dao.hibernate.UserDAOHibernate;

/**
 *
 * @author arunda
 */
public class PaginatedListImpl<T> implements PaginatedList {

	private final List<T> list;
	private final int pageNumber;
	private final int pageSize;

	private static Logger logger = LoggerFactory.getLogger(UserDAOHibernate.class);

	public PaginatedListImpl (List<T> list, int pageNumber, int pageSize) {
		this.list = list;
		this.pageNumber = pageNumber;
		this.pageSize = pageSize;
	}

	/**
	 * @see org.displaytag.pagination.PaginatedList#getFullListSize()
	 */
	@Override
	public int getFullListSize() {
		return list.size();
	}

	/**
	 * @see org.displaytag.pagination.PaginatedList#getList()
	 */
	@Override
	public List<T> getList() {
		return list;
	}

	/**
	 * @see org.displaytag.pagination.PaginatedList#getObjectsPerPage()
	 */
	@Override
	public int getObjectsPerPage() {
		return pageSize;
	}

	/**
	 * @see org.displaytag.pagination.PaginatedList#getPageNumber()
	 */
	@Override
	public int getPageNumber() {
		return pageNumber;
	}

	/**
	 * @see org.displaytag.pagination.PaginatedList#getSearchId()
	 */
	@Override
	public String getSearchId() {
		return null;
	}

	/**
	 * @see org.displaytag.pagination.PaginatedList#getSortCriterion()
	 */
	@Override
	public String getSortCriterion() {
		return null;
	}

	/**
	 * @see org.displaytag.pagination.PaginatedList#getSortDirection()
	 */
	@Override
	public SortOrderEnum getSortDirection() {
		return null;
	}

}
